<script setup>
import { computed } from '@vue/reactivity';
import Item from '../../plugins/item.vue';
import Items from '../../plugins/items.vue';

const errorNames = {
    "required": "该参数为必须上传参数，但未提供",
    "nullable": "该参数不能为Null"
}

const props = defineProps({
    errors: Object
})

const detail = computed(() => {
    return Object.keys(props.errors).filter(k => !!errorNames[k]).map(k => errorNames[k])
}
)


</script>

<template>
    <items :label-width="150" :columns="2">
        <item label="参数名称">{{ errors.Name }}</item>
        <item label="参数位置">{{ errors.In }}</item>
        <item :label="'错误' + (index + 1)" v-for="item, index in detail" :key="index" :columns="2" class="danger">{{ item }}</item>
    </items>
</template>